<template>
  <div>
    <input type="text" @blur="flag =!flag" v-focus v-if="flag" />
    <button @click="qie" v-else>+ {{tag}}</button>
  </div>
</template>
<script>
export default {
  name: '',
  model: {
    prop: 'tag'
  },
  props: {
    tag: String
  },
  data () {
    return {
      flag: false
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    qie () {
      this.flag = true
    }
  },
  directives: {
    focus: {
      inserted (el) {
        el.focus()
      }
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
